package com.yunchang.springboot.mapper.mwsfinance;

import com.yunchang.springboot.models.mwsfinance.FRemoval;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FRemovalMapper {
    int deleteByPrimaryKey(Long id);

    int insert(FRemoval record);

    int insertSelective(FRemoval record);

    FRemoval selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FRemoval record);

    int updateByPrimaryKey(FRemoval record);

    /**
     * 根据订单状态获取对应的数据
     * @param orderStatus
     * @return
     */
    List<FRemoval> selectByOrderStatus(String orderStatus);

    /**
     * 根据订单状态和是否生成下推数据获取对应的数据
     * @param orderStatus
     * @param isGenerateRemovalFee
     * @return
     */
    List<FRemoval> selectByOrderStatusAndIsGenerateRemovalFee(@Param("orderStatus") String orderStatus,@Param("isGenerateRemovalFee")Integer isGenerateRemovalFee);

    /**
     * 根据时间获取对应时间段内的数据IsGenerateRemovalFee的状态
     * @param time
     * @return
     */
    List<FRemoval> selectByCreateTime(String time);

    /**
     * 根据fRemovalList对象集合更新isGenerateRemovalFee
     * @param fRemovalList
     * @return
     */
    int updateIsGenerateRemovalFeeByFRemovalList(@Param("fRemovalList") List<FRemoval> fRemovalList);


    /**
     * 根据是否生成下推数据获取对应的数据
     * @param isGenerateRemovalFee
     * @return
     */
    List<FRemoval> selectByIsGenerateRemovalFee(Integer isGenerateRemovalFee);



    /**
     * 根据日期和是否生成生成出入库明细数据获取对应的数据
     * @param shipmentDate
     * @param isInventoryDetails
     * @return
     */
    List<FRemoval> selectByIsInventoryDetailsAndShipmentDate(@Param("shipmentDate") String shipmentDate, @Param("isInventoryDetails") Integer isInventoryDetails);

    /**
     * 根据fRemovalList对象集合更新是否生成财务数据的状态
     * @param fRemovalList
     * @return
     */
    int updateIsInventoryDetailsByFRemovalList(@Param("fRemovalList") List<FRemoval> fRemovalList);
}